.class public abstract Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;
.super Landroidx/recyclerview/widget/RecyclerView$Adapter;
.source "RecyclerHeadlessAdapter.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Landroidx/recyclerview/widget/RecyclerView$Adapter<",
        "Landroidx/recyclerview/widget/RecyclerView$ViewHolder;",
        ">;"
    }
.end annotation


# instance fields
.field protected displayableObjects:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "TT;>;"
        }
    .end annotation
.end field

.field protected filter:Landroid/widget/Filter;

.field protected itemsList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "TT;>;"
        }
    .end annotation
.end field

.field protected lastConstraint:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 14
    invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;-><init>()V

    .line 18
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->itemsList:Ljava/util/List;

    .line 19
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->displayableObjects:Ljava/util/List;

    const-string v0, ""

    .line 20
    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->lastConstraint:Ljava/lang/String;

    .line 22
    new-instance v0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter$1;

    invoke-direct {v0, p0}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter$1;-><init>(Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;)V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->filter:Landroid/widget/Filter;

    return-void
.end method

.method static synthetic access$000(Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;Ljava/lang/String;)Ljava/util/List;
    .locals 0

    .line 14
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->filterOut(Ljava/lang/String;)Ljava/util/List;

    move-result-object p0

    return-object p0
.end method

.method private filterOut(Ljava/lang/String;)Ljava/util/List;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List<",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation

    .line 91
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 92
    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->itemsList:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    .line 94
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-nez v3, :cond_0

    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v3

    invoke-virtual {p0, v2, p1, v3}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->isItemMatchesConstraint(Ljava/lang/Object;Ljava/lang/String;Ljava/util/Locale;)Z

    move-result v3

    if-nez v3, :cond_0

    goto :goto_0

    .line 97
    :cond_0
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :cond_1
    return-object v0
.end method


# virtual methods
.method public filter(Ljava/lang/String;)V
    .locals 0

    .line 103
    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->lastConstraint:Ljava/lang/String;

    .line 104
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->startFilter(Ljava/lang/String;)V

    return-void
.end method

.method protected abstract getContentViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.end method

.method protected abstract getContentViewType(I)I
.end method

.method public getItemCount()I
    .locals 1

    .line 59
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->displayableObjects:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItemViewType(I)I
    .locals 0

    .line 68
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->getContentViewType(I)I

    move-result p1

    return p1
.end method

.method public getMainItemsCount()I
    .locals 1

    .line 63
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->itemsList:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method protected abstract isItemMatchesConstraint(Ljava/lang/Object;Ljava/lang/String;Ljava/util/Locale;)Z
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;",
            "Ljava/lang/String;",
            "Ljava/util/Locale;",
            ")Z"
        }
    .end annotation
.end method

.method protected abstract onBindContentViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V
.end method

.method public onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V
    .locals 0

    .line 54
    invoke-virtual {p0, p1, p2}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->onBindContentViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V

    return-void
.end method

.method public onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
    .locals 0

    .line 49
    invoke-virtual {p0, p1, p2}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->getContentViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;

    move-result-object p1

    return-object p1
.end method

.method protected publishFilterResults(Ljava/lang/CharSequence;Ljava/util/List;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/CharSequence;",
            "Ljava/util/List<",
            "TT;>;)V"
        }
    .end annotation

    .line 85
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->displayableObjects:Ljava/util/List;

    invoke-interface {p1}, Ljava/util/List;->clear()V

    .line 86
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->displayableObjects:Ljava/util/List;

    invoke-interface {p1, p2}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    .line 87
    invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyDataSetChanged()V

    return-void
.end method

.method public setDisplayedList()V
    .locals 2

    .line 72
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->displayableObjects:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    .line 73
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->displayableObjects:Ljava/util/List;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->itemsList:Ljava/util/List;

    invoke-interface {v0, v1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    .line 80
    invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyDataSetChanged()V

    .line 81
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->lastConstraint:Ljava/lang/String;

    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->startFilter(Ljava/lang/String;)V

    return-void
.end method

.method public setItems(Ljava/util/List;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "TT;>;)V"
        }
    .end annotation

    .line 41
    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->itemsList:Ljava/util/List;

    .line 42
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->displayableObjects:Ljava/util/List;

    invoke-interface {p1}, Ljava/util/List;->clear()V

    .line 43
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->setDisplayedList()V

    return-void
.end method

.method public startFilter(Ljava/lang/String;)V
    .locals 1

    .line 108
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/RecyclerHeadlessAdapter;->filter:Landroid/widget/Filter;

    invoke-virtual {v0, p1}, Landroid/widget/Filter;->filter(Ljava/lang/CharSequence;)V

    return-void
.end method
